# Contributor: Matthew T Hoare <matthew.t.hoare@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Matthew T Hoare <matthew.t.hoare@gmail.com>
pkgname=nwg-launchers
pkgver=0.6.3
pkgrel=0
pkgdesc="GTK+ launchers for sway, i3 and some other window managers"
url="https://github.com/nwg-piotr/nwg-launchers"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	cmake
	gtk-layer-shell-dev
	gtkmm3-dev
	meson
	nlohmann-json
	"
source="https://github.com/nwg-piotr/nwg-launchers/archive/v$pkgver/nwg-launchers-$pkgver.tar.gz"
options="!check"  # no tests provided

for _i in bar dmenu grid; do
	subpackages="$subpackages $pkgname-$_i:_subpackage"
	depends="$depends $pkgname-$_i=$pkgver-r$pkgrel"
done

build() {
	abuild-meson \
		-Dlayer-shell=enabled \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

_subpackage() {
	local name=${subpkgname#$pkgname-}
	case "$subpkgname" in
		bar) pkgdesc="GTK-based button bar for Sway and other window managers";;
		dmenu) pkgdesc="GTK-based dmenu for Sway and other window managers";;
		grid) pkgdesc="GTK-based GNOME-like application grid for Sway and other window managers";;
	esac
	depends=""

	amove usr/bin/nwg$name
	amove usr/share/nwg-launchers/nwg$name
}

sha512sums="
36bb9179a8231d8200dddffd18b3e38a047a87828c95fd2dd0fe2a525856ea17bbd9fe51f4549ca4d3a6db555b94d30a606c0a874021b69f1af34f57a9f6ac28  nwg-launchers-0.6.3.tar.gz
"
